
            <h1 align="center">
              团购信息管理 
            </h1>
          </div>

          <div class="panel panel-default">
          
          <!-- Default panel contents -->
          <!--
          <div class="panel-heading">历史记录</div>
          -->

          <!-- Table -->
          <table class="table">
            <thead>
              <tr>
                <th>团购ID</th>
                <th>团购LOGO</th>
                <th>团购名称</th>
                <th>团购简介</th>
                <th>团购图片</th>
                <th>购买量/限购总量</th>
                <th>购买人数/限购人数</th>
                <th>购买有效期</th>
                <th>使用有效期</th>
                <th>状态</th>
                <th>操作</th>
                <?php 
                  if($user == 'admin')
                    echo '<th>第三方KEY</th>';
                ?>
              </tr>
            </thead>
            <tbody>
              <?php foreach ($grouplist as $question_item): ?>
                <tr>
                  <td><?php echo $question_item['group_id'] ;?></td>
                  <td>
                    <a href="<?php echo base_url($question_item['logo_pic']) ;?>">
                      <img src="<?php echo base_url($question_item['logo_pic']) ;?>" width="100" />
                    </a>
                  </td>
                  <td><?php echo $question_item['group_name'] ;?></td>
                  <td><?php echo $question_item['brief_des'] ;?></td>
                  <td>
                    <?php 
                      if($user == 'admin')
                        echo '<a href="' . site_url("groupadmin/piclist?group_id=") . $question_item['group_id'] . '">管理</a>';
                      if($user == 'store')
                        echo '<a href="' . site_url("storeadmin/piclist?group_id=") . $question_item['group_id'] . '">查看</a>';
                    ?>
                  </td>
                  <td><?php echo $question_item['buy_num'] . "/" .  $question_item['group_capacity'];?></td>
                  <td><?php echo $question_item['user_num'] . "/" .  $question_item['user_capacity'];?></td>
                  <td><?php echo $question_item['buy_deadline'] ;?></td>
                  <td><?php echo $question_item['use_deadline'] ;?></td>
                  <td>
                    <?php 
                      $state = $question_item['group_state'];
                      if($state == 1)
                        echo "出售中";
                      else if ($state == 2)
                        echo "超出购买期限";
                      else if($state == 3)
                        echo "超出使用期限";
                      else if($state ==4)
                        echo "已删除";
                      else if($state ==5)
                        echo "历史版本";
                      else
                        echo "状态异常";
                    ?>
                  </td>
                  <td>
                    <?php
                    if($user == 'admin')
                    {
                      $state = $question_item['group_state'];
                      if($state != 4 )
                        echo "<a href='" . site_url("groupadmin/updategroup?group_id=") . $question_item['group_id'] . "'>修改</a>/";
                      if($state == 4 )
                        echo "<a href='" . site_url("groupadmin/backgroup?group_id=") . $question_item['group_id'] . "'>恢复</a>";
                      else
                        echo "<a href='" . site_url("groupadmin/deletegroup?group_id=") . $question_item['group_id'] . "'>删除</a>";
                      echo "<br/>";
                      echo "<a href='" . site_url("groupadmin/groupversionlist?group_his_id=") . $question_item['group_his_id'] . "'>历史版本</a>";
                    }
                    if($user == 'store')
                    {
                      echo "<a href='" . site_url("storeadmin/groupversionhistory?group_his_id=") . $question_item['group_his_id'] . "'>订单列表</a>";
                      echo "<br/>";
                      echo "<a href='" . site_url("storeadmin/groupversionlist?group_his_id=") . $question_item['group_his_id'] . "'>历史版本</a>";                 
                    }
                    ?>
                  </td>
                  <?php
                    if($user == 'admin')
                    {
                      echo '<td>';
                      echo $question_item['store_key'].'<br/>';
                      echo '<a href="'.site_url("storeadmin").'" target="_blank">管理</a>';
                      echo '</td>';
                    }
                  ?>
                </tr>
              <?php endforeach ?>
            </tbody>
          </table>
        </div>
